home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 1.0 / CIncludes / IOCtl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-06  |  1.6 KB  |  58 lines  |  [TEXT/MPS ]

  1. /*
  2.     IOCtl.h -- Device-handler-specific requests
  3.  
  4.     Warning:  This interface is NOT a part of the ANSI C standard.
  5.              We do NOT claim to be POSIX compliant.
  6.              If you want your code to be portable, don't use this interface.
  7.  
  8.     Copyright, Apple Computer Inc. 1985-1991, 1994
  9.     All rights reserved.
  10.  
  11. */
  12.  
  13. # ifndef __IOCTL__
  14. # define __IOCTL__
  15.  
  16. /*
  17.  *        ioctl() function prototype
  18.  */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. int ioctl(int fildes, unsigned int cmd, long *arg);
  25.  
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29.  
  30. /*
  31.  *   IO Control commands.
  32.  *
  33.  *   IOCTLs which begin with "FIO" are controls which are general
  34.  *          (device driver) control requests.  They may be executed by 
  35.  *         the top-level ioctl() procedure, or previewed by it before 
  36.  *         passing it on to the driver xxIoctl()s.
  37.  */
  38.  
  39. # define FIOLSEEK         (('f'<<8)|0x00)     /* Apple internal use only */
  40. # define FIODUPFD         (('f'<<8)|0x01)     /* Apple internal use only */
  41.  
  42. # define FIOINTERACTIVE (('f'<<8)|0x02)     /* If device is interactive */
  43. # define FIOBUFSIZE        (('f'<<8)|0x03)     /* Return optimal buffer size */
  44. # define FIOFNAME         (('f'<<8)|0x04)     /* Return filename */
  45. # define FIOREFNUM        (('f'<<8)|0x05)     /* Return fs refnum */
  46. # define FIOSETEOF        (('f'<<8)|0x06)     /* Set file length */
  47.  
  48. /*
  49.  *   IOCTLs which begin with "TIO" are for TTY (i.e., console or 
  50.  *         terminal-related) device control requests.
  51.  */
  52.  
  53. # define TIOFLUSH   (('t'<<8)|0x00)        /* discard unread input.  arg is ignored */
  54. # define TIOSPORT   (('t'<<8)|0x01)        /* Obsolete -- do not use */
  55. # define TIOGPORT   (('t'<<8)|0x02)        /* Obsolete -- do not use */
  56.  
  57. # endif /*__IOCTL__*/
  58.